package main

import "fmt"

func main() {

	s := []int{1, 2, 2, 2, 5, 4, 2}

	length := len(s)
	m := make(map[int]int, 0)
	for i := 0; i < length; i++ {
		if _, ok := m[s[i]]; ok {
			m[s[i]]++
		} else {
			m[s[i]] = 1
		}
		if m[s[i]] > length/2 {
			fmt.Println(s[i])
		}
	}

}
